package TwoDay;
//8.斐波拉契数列中小于1000的最大数
public class StudyFor8 {
    public static void main(String[] args) {
        int f0 = 0, f1 = 1, f2 = 1;
        while (f2<1000) {
            f0=f1;
            f1=f2;
            f2=f0+f1;
        }
        System.out.println("f2 = " + f2);
    }
}
